package org.bright.controller;

import org.bright.config.UserProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/hello")
@RestController
public class HelloController {


    @Value("${user.name}")
    private String name;
    @Value("${user.sex}")
    private String sex;
    @Value("${user.age}")
    private Integer age;

    @Autowired
    private UserProperties user;


    @GetMapping("/world")
    public String helloWorld() {
        System.out.println(user.toString());
        return "Hello World";
    }
}
